package com.wql.convert.num2str;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

/**
 * 参数化测试
 * 
 * @author wuqinglong
 * @time 2013年12月27日 下午1:44:58
 * @email hellowql@126.com
 * 
 */
@RunWith(Parameterized.class)
public class Num2StrTestWithParam {

	private String expected;
	private String target;

	public Num2StrTestWithParam(String expected, String target) {
		this.expected = expected;
		this.target = target;
	}

	@Parameters
	public static Collection<Object[]> params() {
		return Arrays.asList(new Object[][] { { "", null }, { "一", "1" }, { "十", "10" }, { "十一", "11" },
				{ "二十", "20" }, { "二十一", "21" }, { "九十九", "99" }, { "一百一十一", "111" }, { "二百一十", "210" },
				{ "一千零十", "1010" }, { "一千零十一", "1011" }, { "一千零一", "1001" }, { "一百万零一百零一", "1000101" },
				{ "一千零十万零一百零一", "10100101" }, { "十亿零十万零一百零一", "1000100101" }, { "二十亿零二十万零一百零一", "2000200101" },
				{ "一亿亿一千一百一十一万一千一百二十亿零二十万零一百零一", "11111112000200101" },
				{ "一亿亿一千一百一十万一千一百二十亿零二十万零一百零一", "11110112000200101" },
				{ "二亿亿二千二百二十二万二千二百二十亿零二十万零一百零一", "22222222000200101" }, });
	}

	@Test
	public void test() {
		assertEquals(expected, Num2Str.convert(target != null ? Long.parseLong(target) : null));
	}
}
